
<!--
 * @Author: CNN 969682281@qq.com
 * @Date: 2023-03-07 13:36:39
 * @LastEditors: CNN 969682281@qq.com
 * @LastEditTime: 2024-01-05 15:44:10
 * @FilePath: \newMould_BHZ\src\views\WaterManage\trends\instantly.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <!-- 水稳----动态监控---实时监控 -->
  <div class="department" id="department">
    <!-- 右侧 -->
    <div class="department_right partner">
      <div class="app-container-btn">
        <el-button @click="goBack">返回</el-button>
      </div>
      <!-- 表格 -->
      <div
        class="text_table TensionRealTime multistageHeader TensionRealTimeFirstLevel"
      >
        <tableData
          :stripe="false"
          height="100%"
          :config="tableDataLook"
          :dataList="tableDataFrom"
          :loading="listLoading"
          @selection-change="selectionChange"
          @sort-change="sortChange"
          @click-change="rowChange"
          @ClickOnLine="ClickOnLine"
        />
      </div>
    </div>
  </div>
</template>
  
<script>
import TableData from "@/components/waterManage/public/el-tables"; //主页面列表
import formJs from "./regexDetail.js"; //新增弹框配置项
import {
  getGroutingProcess, //查看--过程数据列表
} from "@/api/request.js";
import { statusTypes1 } from "@/utils/config"; //配置项
export default {
  name: "GroutRealTimeFirstLevel",
  components: {
    TableData, //主页面列表
  },
  data() {
    return {
      name: "GroutRealTimeFirstLevel", //按钮配置页面代号
      listLoading: false, //列表数据加载loading
      userInfo: {}, //登录用户
      // 查看
      rowInfo: null, //当前行信息
      tableDataLook: formJs.tableDataLook,
      tableDataFrom: [],
      // 查看
      BeamData: {
        data: "",
        fCompanyid: "",
      },
    };
  },

  mounted() {
    if (JSON.parse(sessionStorage.getItem("GxGroutManage_beam"))) {
      this.BeamData = JSON.parse(sessionStorage.getItem("GxGroutManage_beam"));
      this.yj_viewForm(this.BeamData);
    }

    this.userInfo = JSON.parse(sessionStorage.getItem("GxEmbedded_userInfo"));
    this.tableDataLook.thead[15]["callback"] = function (rowData) {
      let data = statusTypes1[rowData.fWarninglevel];
      if (data) {
        return data.label;
      }
    };
    this.tableDataLook.thead[15]["specialClass"] = function (rowData) {
      let data = statusTypes1[rowData.fWarninglevel];
      if (data) {
        return data.className;
      }
    };
  },
  methods: {
    // 查看
    yj_viewForm(data) {
      // if (this.$route.query.data != "" && this.$route.query.data != null) {
      this.tableDataFrom = [];
      getGroutingProcess({
        beamId: data.data,
        fCompanyid: data.fCompanyid,
      })
        .then((res) => {
          if (res.errcode == 0) {
            var that = this;
            that.tableDataFrom = res.data.groutingProcess;
          } else {
            this.$message.error(res.msg);
          }
        })
        .catch((error) => {
          this.$message.error(error.msg);
        });
      // } else {
      //   return this.$message.error("请先选择需要查看的数据");
      // }
    },
    // 点击当前行
    rowChange(row) {
      this.rowInfo = row; //当前行信息
    },
    // 查看过程数据
    ClickOnLine(row, label) {
      if (label == "过程") {
        var data = {
          fNamberid: row.fNamberid,
          fCompanyid: this.BeamData.fCompanyid,
        };
        window.sessionStorage.setItem("GxEmbedded_two", JSON.stringify(data));

        this.$router.push({
          path: "/groutManage/groutRealTimesecondLevel",
        });
      }
    },
    goBack() {
      this.$router.back();
      window.sessionStorage.removeItem("GxGroutManage_beam");
    },
    // 多选方法
    selectionChange() {},
    // 排序方法
    sortChange() {},
  },
};
</script>
  
  
<style scoped lang='less'>
.printTables {
  background: #fff;
  display: flex;
  justify-content: end;
  padding: 5px;
  margin-top: 10px;
}

.dialogBody {
  padding: 3px 20px;
  height: 98%;

  /* overflow-y: auto; */
  .dialogBodyBox {
    width: 100%;

    .tab {
      display: flex;
      font-size: 14px;
      height: 30px;
      line-height: 30px;
      box-sizing: border-box;
      border-bottom: 2px solid #e4e7ed;
      padding: 0 0.16rem;

      .btn {
        margin-top: 4px;
        // margin-right: 16px;
        width: 80px;
        height: 24px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-top-right-radius: 4px;
        border-top-left-radius: 4px;
      }
    }

    .charts {
      height: calc(100% - 30px);
    }
  }
}

.mechanism_dialogS /deep/ .el-table__body-wrapper {
  height: calc(100% - 84px);
  overflow-y: auto;
}

.mechanism_dialogS /deep/ .el-table__body-wrapper::-webkit-scrollbar {
  width: 10px; //调纵向滚动条显示隐藏
  height: 10px; //调横向滚动条显示隐藏
  z-index: 99999999 !important;
}

.common .block {
  bottom: 5px !important;
}
</style>
  